const timeTool = require('../../utils/timeTool.js')
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    relationid: '',
    createUid: '',
    date: '',
    list: [],
    isorg: null,
    orgid:'',
  },

  getlist() {
    var that = this
    app.req({
      url: "orgmini/resumptionWork/reportList",
      data: {
        orgId: that.data.orgid,
        createUid: that.data.createUid,
        date: that.data.date
      },
      success: function (res) {
        if (res.code == 200) {
          wx.setNavigationBarTitle({
            title: res.data[0].reportName + '的详情'
          })
          res.data[0].reportDate = timeTool.itemDateToShow(res.data[0].reportDate,1,false,false)
          that.setData({
            list: res.data
          })
        }
      }
    })
  },
  topage(e) {
    wx.navigateTo({
      url: '/packageA/pages/epidemicSeeNew/epidemicSeeNew?id=' + this.data.orgid + '&isshow=' + this.data.isorg + '&listid=' + e.currentTarget.dataset.id + '&isorg=' + this.data.isorg + '&avaimg=' + e.currentTarget.dataset.avaimg,
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      orgid: options.orgid,
      createUid: options.createUid,
      date: options.date,
      isorg: options.isorg
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getlist()
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})